package com.xhej.rowreat.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageInfo;
import com.xhej.rowreat.model.User;
import com.xhej.rowreat.service.UserService;

@RestController
@RequestMapping("/users")
public class UserController {
		@Autowired
	    private UserService userService;
	
	    @RequestMapping("/all")
	    public @ResponseBody PageInfo<User> getAll() {
	        List<User> userInfoList = userService.getAllUser();
	        PageInfo<User> list = new PageInfo<User>(userInfoList);
	        
	        userService.insertUser();
	        return list;
	    }
}
